import { dialog } from 'electron'
import { IEventHandler, IRenderReplyMessage } from '../EventHandler'
export class SelectDirectory implements IEventHandler {
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    handle(messageId: string, params?: unknown): IRenderReplyMessage<unknown> {
        const dir = dialog.showOpenDialogSync({
            properties: ['openDirectory']
        })
        if (dir && dir.length > 0) {
            return { messageId: messageId, data: dir[0], isSuccess: true }
        }
        return { messageId: messageId, isSuccess: false }
    }
}
